/**
 * Created with JetBrains PhpStorm.
 * User: jiangshuguang
 * Date: 14-9-27
 * Time: 下午3:26
 * To change this template use File | Settings | File Templates.
 */
(function(){
    var ShareTip = require("wap_common:widget/ui/sharetip/sharetip.js").ShareTip,
        util = require("wap_common:widget/ui/libs/util.js").util,
        $page = $(".main-index"),
        $todayProfit = $page.find(".today-profit"),
        $typeStatistic = $page.find(".type-statistic"),
        shareTip;

    shareTip = new ShareTip({
        content:'' +
            '<div>恭喜你注册成功！</div>' +
            '<div>关注真融宝服务号， 15%年化收益率+各种给力活动 ，统统都是你的！</div>'
    });


    if(util.getUrlParams()['from_register']){
        shareTip.showAttention();
    }

    $.getJSON("/plat/plat_fund_summary",function(ret,status){
        if(status == "success" && ret.error_no==0){
            var data = ret.data,
                weight_profit_years_percent = util.toPercent(data.weight_profit_years_percent);
            $todayProfit.find(".data").text(weight_profit_years_percent);
            $typeStatistic.find(".user_count").text(ret.user_count);
            $typeStatistic.find(".plat_total_buy").text(util.toCredit(data.plat_total_buy));
            $typeStatistic.find(".credit_plat_total").text(data.credit_plat_total);
            $typeStatistic.find(".credit_assemble_total").text(data.credit_assemble_total);
        }
    });

})();